<?php

namespace app\modules\api\controllers;

use yii;
use app\constants\Code;
use app\components\XSecurity;

class TestController extends BaseController
{
	public function actionIndex()
	{
		$dada = ["type" => "login","uid" => 15 ,"uname" => "haha888"];
		$dada = ["ctr" => "login","act" => 15 ,"data" => ["uid" => 18,"uname" => "haha888"]];
		$this->rspSuccess("ok",$dada);

	}
	/**
	 * 加密解密示例
	 */
	public function actionDes()
	{
		$username = "daqianshijie";
		$username1 = XSecurity::apiSTD3Encrypt($username);
		
		$username1 = urldecode($username1);//如果经过浏览器请求，会自动urldecode
		$username = XSecurity::apiSTD3Decrypt($username1);
		$this->rspSuccess("陈赤赤",$username);
	}
}